<?PHP
class JSONResult extends BaseResult
{
  public function show()
  {
	 $context = $this->getContext();
	 
	 array_walk_recursive($context, function(&$property, $key) {
		if (method_exists($property, "exportVars"))
		{
		   $property = $property->exportVars();
		}
	 });

	 header("Content-Type: application/json");

	 echo json_encode($context);
  }
}